package com.dsteiner.widgets.client.util;

import com.dsteiner.widgets.client.Widgets.IWidget;

public class CssUtil {

	public static void setStyleName(IWidget widget, String styleName) {
		String oldStyleName = widget.getStyleName();
		widget.setStyleName(styleName);
		String[] styleNames = oldStyleName.split(" ");
		for (int i = 0; i < styleNames.length; i++) {
			if(!styleNames[i].equals(styleName) && !styleNames[i].equals(""))
				widget.addStyleName(styleNames[i]);
		}
	}

}
